<div class="modal">
<div class="modal-dialog modal-lg">
    <div class="modal-content box" uib-modal-transclude=""><div class="modal-header ng-scope">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="close()">
            <span aria-hidden="true">×</span></button>
        <h4 class="modal-title ng-binding">表达式</h4>
        </div>
        <div class="modal-body ng-scope">
        <div class="row">
            <div class="col-md-12 form-horizontal">
                <div class="form-group">
                    <label class="col-sm-2 control-label ng-binding">字段</label>
                    <div class="col-sm-10">
                        <div class="form-control" style="min-height: 35px;height: auto;padding: 0px">
                            <span *ngFor="let o of columnObjs" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.column)">createDate</span>
                            <span *ngFor="let o of columnObjs" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.column)">energy_type</span>
                            <span *ngFor="let o of columnObjs" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.column)">energy_value</span>
                            <span *ngFor="let o of columnObjs" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.column)">id</span>
                            <span *ngFor="let o of columnObjs" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.column)">plant</span>
                            <span *ngFor="let o of columnObjs" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.column)">月份</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label ng-binding">聚合</label>
                    <div class="col-sm-10">
                        <div class="form-control" style="min-height: 35px;height: auto;padding: 0px">
                            <span *ngFor="let o of aggregate" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.value+'()',true)">sum</span><!-- end ngRepeat: o in aggregate --><span *ngFor="let o of aggregate" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.value+'()',true)">count</span><!-- end ngRepeat: o in aggregate --><span *ngFor="let o of aggregate" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.value+'()',true)">avg</span><!-- end ngRepeat: o in aggregate --><span *ngFor="let o of aggregate" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.value+'()',true)">max</span><!-- end ngRepeat: o in aggregate --><span *ngFor="let o of aggregate" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.value+'()',true)">min</span><!-- end ngRepeat: o in aggregate --><span *ngFor="let o of aggregate" class="btn btn-default btn-sm ng-binding ng-scope" style="margin: 3px 3px;" (click)="addToken(o.value+'()',true)">distinct</span><!-- end ngRepeat: o in aggregate -->
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label ng-binding">可选表达式</label>
                    <div class="col-sm-10">
                        <div class="form-control" style="min-height: 35px;height: auto;padding: 0px">
                    <!-- ngRepeat: o in expressions -->
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label ng-binding">表达式</label>
                    <div class="col-sm-10">
                        <div id="expression_area" ui-ace="expAceOpt" ng-model="data.expression" class="form-control ng-pristine ng-untouched ng-valid ace_editor ace-tm" title="用于聚合后再计算. 使用上面的点击辅助输入避免输入错误. 如: Math.log(sum(columnA)/count(columB))" style="font-size: 14px; height: 160px;">
                            <div style="position: absolute;"></div>
                            <textarea class="ace_text-input" wrap="off" autocorrect="off" autocapitalize="off" spellcheck="false" style="opacity: 0; height: 16px; width: 7.6975px; left: 46px;"></textarea>
                            
                            </div>
                        <!--<textarea ng-model="data.expression" id="expression_area" class="form-control" placeholder="{{'TIPS.CAL_EXPR'|translate}}"></textarea>-->
                    </div>
                </div>
                <!-- ngRepeat: alert in alerts -->
                <div class="form-group">
                    <label class="col-sm-2 control-label ng-binding">别名</label>
                    <div class="col-sm-10">
                        <input class="form-control ng-pristine ng-untouched ng-valid" ng-model="data.alias">
                    </div>
                </div>
            </div>
        </div>
        </div>
        <div class="modal-footer ng-scope">
        <button type="button" class="btn btn-default pull-left ng-binding" data-dismiss="modal" (click)="close()">取消</button>
        <!--<button type="button" class="btn btn-primary" (click)="verify()">{{'CONFIG.WIDGET.CHECK'|translate}}</button>-->
        <button type="button" class="btn btn-primary ng-binding" (click)="ok()">确认</button>
        </div>
    </div>
</div>
</div>